package cn.doitedu.utils;

import org.apache.commons.lang.time.DateUtils;

import java.util.Calendar;
import java.util.Date;

/**
 * @create: 2021-11-16 20:00
 * @author: 静如海的男人
 * @program: eagle-markting
 * 取整工具类
 **/

public class TimeBoundUtil {
    //向上取整,减去两个小时
    public static long getTimeBound(long currentTime) {
        Date dt = DateUtils.ceiling(new Date(currentTime), Calendar.HOUR);
        return dt.getTime() - 2 * 3600 * 1000;
    }
}
